home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / PGUIDE / MDI / FIND.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-12  |  4.8 KB  |  153 lines

  1. VERSION 5.00
  2. Begin VB.Form frmFind 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Find"
  5.    ClientHeight    =   1395
  6.    ClientLeft      =   2655
  7.    ClientTop       =   3585
  8.    ClientWidth     =   4950
  9.    BeginProperty Font 
  10.       Name            =   "MS Sans Serif"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   700
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    Height          =   1800
  19.    Left            =   2595
  20.    LinkTopic       =   "Form2"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   1395
  24.    ScaleWidth      =   4950
  25.    Top             =   3240
  26.    Width           =   5070
  27.    Begin VB.Frame Frame1 
  28.       Caption         =   "Direction"
  29.       Height          =   612
  30.       Left            =   1560
  31.       TabIndex        =   3
  32.       Top             =   720
  33.       Width           =   2052
  34.       Begin VB.OptionButton optDirection 
  35.          Caption         =   "&Down"
  36.          Height          =   252
  37.          Index           =   1
  38.          Left            =   960
  39.          TabIndex        =   5
  40.          ToolTipText     =   "Search to End of Document"
  41.          Top             =   240
  42.          Value           =   -1  'True
  43.          Width           =   852
  44.       End
  45.       Begin VB.OptionButton optDirection 
  46.          Caption         =   "&Up"
  47.          Height          =   252
  48.          Index           =   0
  49.          Left            =   240
  50.          TabIndex        =   4
  51.          ToolTipText     =   "Search to Beginning of Document"
  52.          Top             =   240
  53.          Width           =   612
  54.       End
  55.    End
  56.    Begin VB.CheckBox chkCase 
  57.       Caption         =   "Match &Case"
  58.       Height          =   495
  59.       Left            =   120
  60.       TabIndex        =   2
  61.       ToolTipText     =   "Case Sensitivity"
  62.       Top             =   720
  63.       Width           =   1335
  64.    End
  65.    Begin VB.TextBox Text1 
  66.       Height          =   500
  67.       Left            =   1200
  68.       TabIndex        =   1
  69.       ToolTipText     =   "Text to Find"
  70.       Top             =   120
  71.       Width           =   2415
  72.    End
  73.    Begin VB.CommandButton cmdcancel 
  74.       Cancel          =   -1  'True
  75.       Caption         =   "Cancel"
  76.       Height          =   372
  77.       Left            =   3720
  78.       TabIndex        =   7
  79.       ToolTipText     =   "Return to Notepad"
  80.       Top             =   600
  81.       Width           =   1092
  82.    End
  83.    Begin VB.CommandButton cmdFind 
  84.       Caption         =   "&Find"
  85.       Default         =   -1  'True
  86.       Height          =   372
  87.       Left            =   3720
  88.       TabIndex        =   6
  89.       ToolTipText     =   "Start Search"
  90.       Top             =   120
  91.       Width           =   1092
  92.    End
  93.    Begin VB.Label Label1 
  94.       Caption         =   "Fi&nd What:"
  95.       Height          =   255
  96.       Left            =   120
  97.       TabIndex        =   0
  98.       Top             =   240
  99.       Width           =   975
  100.    End
  101. Attribute VB_Name = "frmFind"
  102. Attribute VB_Base = "0{B61445DA-CA75-11CF-84BA-00AA00C007F0}"
  103. Attribute VB_Creatable = False
  104. Attribute VB_TemplateDerived = False
  105. Attribute VB_PredeclaredId = True
  106. Attribute VB_Exposed = False
  107. Attribute VB_Customizable = False
  108. '*** Find dialog box for searching text.        ***
  109. '*** Created for MDI Notepad sample application ***
  110. '*** Uses: public variables gFindCase (toggles  ***
  111. '*** case sensitivity); gFindString (text to    ***
  112. '*** find); gFindDirection (toggles search      ***
  113. '*** direction); gFirstTime (toggles start from ***
  114. '*** beginning of text)                         ***
  115. '**************************************************
  116. Option Explicit
  117. Private Sub chkCase_Click()
  118.     ' Assign a value to the public variable.
  119.     gFindCase = chkCase.Value
  120. End Sub
  121. Private Sub cmdCancel_Click()
  122.     ' Save the values to the public variables.
  123.     gFindString = Text1.Text
  124.     gFindCase = chkCase.Value
  125.     ' Unload the find dialog.
  126.     Unload frmFind
  127. End Sub
  128. Private Sub cmdFind_Click()
  129.     ' Assigns the text string to a public variable.
  130.     gFindString = Text1.Text
  131.     FindIt
  132. End Sub
  133. Private Sub Form_Load()
  134.     ' Disable the find button - no text to find yet.
  135.     cmdFind.Enabled = False
  136.     ' Read the public variable & set the option button.
  137.     optDirection(gFindDirection).Value = 1
  138. End Sub
  139. Private Sub optDirection_Click(index As Integer)
  140.     ' Assign a value to the public variable.
  141.     gFindDirection = index
  142. End Sub
  143. Private Sub Text1_Change()
  144.     ' Set the public variable.
  145.     gFirstTime = True
  146.     ' If the textbox is empty, disable the find button.
  147.     If Text1.Text = "" Then
  148.         cmdFind.Enabled = False
  149.     Else
  150.         cmdFind.Enabled = True
  151.     End If
  152. End Sub
  153.